<!DOCTYPE html>
<html lang="zh">

<head>

    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <meta name="format-detection" content="telephone=yes" />
        <link rel="stylesheet" href="../res/css/weui.css" />
        <link rel="stylesheet" href="../res/css/weuix.css" />
        <link rel="stylesheet" href="../res/css/mp_common.css" />
        <link rel="stylesheet" href="../res/css/common.css" />
        <script src="../res/js/zepto.min.js"></script>
        <script src="../res/js/zepto.weui.js"></script>
        <script src="../res/js/mp_common.js?v=1"></script>
        <script src="../res/js/qrcode.min.js"></script>
        <script src="../res/js/common.js"></script>
        <script src="../res/js/JsBarcode.all.min.js" type="text/javascript"></script>
    </head>
</head>
<style type="text/css">
    html,
    body {
        width: 100%;
        height: 100%;
    }

    * {
        margin: 0px;
        padding: 0px;
    }

    body,
    button,
    input,
    select,
    textarea {
        font: 12px/16px Verdana, Helvetica, Arial, sans-serif;
    }

    .fixed-top {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 100;
    }

    p {
        width: 603px;
        padding-top: 3px;
        overflow: hidden;
    }

    .btn {
        width: 142px;
    }

    #container {
        width: 100%;
        height: 100%;
    }
</style>
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<script>
    var loc_x = getQst("loc_x")
    var loc_y = getQst("loc_y")
    let address = getQst('address')

    // var qq
    // qq.maps = TMap

    function ToPage() {
        goPageNo(-1);
    }
    window.onload = function () {
        //返回列表
        //直接加载地图
        //初始化地图函数  自定义函数名init
        var init = function() {
            var center
            if(address){
                $.get(
                    `https://apis.map.qq.com/ws/geocoder/v1/?address=${address}&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77`,
                    function (res){
                        console.log(res)
                    }
                )
                let params = {
                    key: 'OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77',
                    address
                }
                $.ajax({
                    type: 'get',
                    url: `https://apis.map.qq.com/ws/geocoder/v1/?address=${address}&key=NVUBZ-I2U3J-BVEFJ-K45HZ-AS6B5-7FFL7`,
                    async: false,
                    data: params,
                    dataType: 'jsonp',
                    headers: {
                        'Access-Control-Allow-Origin': '*',
                        'Access-Control-Allow-Methods': 'GET,POST',
                    },
                    success: function (res) {
                        console.log(res)
                    },
                    error: function (xhr, errorType, error) {
                        console.log('xhr', xhr)
                        console.log('errorType', errorType)
                        console.log('error', error)
                    },
                    complete: function () { },
                })
                var geocoder = new TMap.service.Geocoder()
                geocoder.getLocation({address}).then(console.log)
            }else{
                center = new qq.maps.LatLng(loc_x,loc_y);
            }
            var map = new qq.maps.Map(document.getElementById('container'),{
                center: center,
                zoom: 15
            });
            var marker = new qq.maps.Marker({
                position: center,
                map: map
            });
        }
        //调用初始化函数地图
        init();
    }
</script>

<body ontouchstart>
    <div class="fixed-top" style="padding: 7px 2px; background-color: #ffffff; font-size: 18px; ">
        <div class="weui-flex__item">
            <div class="placeholder">
                <span class="icon icon-109" style=" margin-left: 8px;" onclick="ToPage()"></span>
                <span style="padding-left: 33%;">订单信息</span>
            </div>
        </div>
    </div>
    <!--   定义地图显示容器   -->
    <div id="container"></div>
</body>
</html>